<?php


namespace App\Command\Syncdata;


use App\Web\Model\Message;
use EchoPHP\Console\Command;

class MessageRead extends Command {
    protected $signature = "syncdata:messageRead {userid? : '指定批量处理的用户id,不填则获取全部'}";
    protected $description = '将用户两个月前的未读消息全部重置为已读';

    public function handle() {
        $userId = $this->argument('userid');
        $userId = intval($userId) > 0 ? intval($userId) : 0;

        $messageModel = new Message();
        $messageModel->handleAllReadStatusBefore($userId);
    }
}